/*
 * XML Type:  XPairItem
 * Namespace: http://www.seedwill.com/xul/core
 * Java type: com.seedwill.xul.core.XPairItem
 *
 * Automatically generated - do not modify.
 */
package com.seedwill.xul.core.impl;
/**
 * An XML XPairItem(@http://www.seedwill.com/xul/core).
 *
 * This is a complex type.
 */
public class XPairItemImpl extends com.seedwill.xul.core.impl.XIdentifiedImpl implements com.seedwill.xul.core.XPairItem
{
    private static final long serialVersionUID = 1L;
    
    public XPairItemImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName TEXT$0 = 
        new javax.xml.namespace.QName("", "text");
    private static final javax.xml.namespace.QName VALUE$2 = 
        new javax.xml.namespace.QName("", "value");
    private static final javax.xml.namespace.QName TAG$4 = 
        new javax.xml.namespace.QName("", "tag");
    private static final javax.xml.namespace.QName ISTREENODE$6 = 
        new javax.xml.namespace.QName("", "isTreeNode");
    private static final javax.xml.namespace.QName CHILDRENITEM$8 = 
        new javax.xml.namespace.QName("", "childrenItem");
    
    
    /**
     * Gets the "text" element
     */
    public java.lang.String getText()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TEXT$0, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "text" element
     */
    public org.apache.xmlbeans.XmlString xgetText()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(TEXT$0, 0);
            return target;
        }
    }
    
    /**
     * True if has "text" element
     */
    public boolean isSetText()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(TEXT$0) != 0;
        }
    }
    
    /**
     * Sets the "text" element
     */
    public void setText(java.lang.String text)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TEXT$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(TEXT$0);
            }
            target.setStringValue(text);
        }
    }
    
    /**
     * Sets (as xml) the "text" element
     */
    public void xsetText(org.apache.xmlbeans.XmlString text)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(TEXT$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(TEXT$0);
            }
            target.set(text);
        }
    }
    
    /**
     * Unsets the "text" element
     */
    public void unsetText()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(TEXT$0, 0);
        }
    }
    
    /**
     * Gets the "value" element
     */
    public org.apache.xmlbeans.XmlAnySimpleType getValue()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlAnySimpleType target = null;
            target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().find_element_user(VALUE$2, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "value" element
     */
    public boolean isSetValue()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(VALUE$2) != 0;
        }
    }
    
    /**
     * Sets the "value" element
     */
    public void setValue(org.apache.xmlbeans.XmlAnySimpleType value)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlAnySimpleType target = null;
            target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().find_element_user(VALUE$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().add_element_user(VALUE$2);
            }
            target.set(value);
        }
    }
    
    /**
     * Appends and returns a new empty "value" element
     */
    public org.apache.xmlbeans.XmlAnySimpleType addNewValue()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlAnySimpleType target = null;
            target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().add_element_user(VALUE$2);
            return target;
        }
    }
    
    /**
     * Unsets the "value" element
     */
    public void unsetValue()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(VALUE$2, 0);
        }
    }
    
    /**
     * Gets the "tag" element
     */
    public org.apache.xmlbeans.XmlAnySimpleType getTag()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlAnySimpleType target = null;
            target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().find_element_user(TAG$4, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "tag" element
     */
    public boolean isSetTag()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(TAG$4) != 0;
        }
    }
    
    /**
     * Sets the "tag" element
     */
    public void setTag(org.apache.xmlbeans.XmlAnySimpleType tag)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlAnySimpleType target = null;
            target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().find_element_user(TAG$4, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().add_element_user(TAG$4);
            }
            target.set(tag);
        }
    }
    
    /**
     * Appends and returns a new empty "tag" element
     */
    public org.apache.xmlbeans.XmlAnySimpleType addNewTag()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlAnySimpleType target = null;
            target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().add_element_user(TAG$4);
            return target;
        }
    }
    
    /**
     * Unsets the "tag" element
     */
    public void unsetTag()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(TAG$4, 0);
        }
    }
    
    /**
     * Gets the "isTreeNode" element
     */
    public boolean getIsTreeNode()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(ISTREENODE$6, 0);
            if (target == null)
            {
                return false;
            }
            return target.getBooleanValue();
        }
    }
    
    /**
     * Gets (as xml) the "isTreeNode" element
     */
    public org.apache.xmlbeans.XmlBoolean xgetIsTreeNode()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlBoolean target = null;
            target = (org.apache.xmlbeans.XmlBoolean)get_store().find_element_user(ISTREENODE$6, 0);
            return target;
        }
    }
    
    /**
     * True if has "isTreeNode" element
     */
    public boolean isSetIsTreeNode()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(ISTREENODE$6) != 0;
        }
    }
    
    /**
     * Sets the "isTreeNode" element
     */
    public void setIsTreeNode(boolean isTreeNode)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(ISTREENODE$6, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(ISTREENODE$6);
            }
            target.setBooleanValue(isTreeNode);
        }
    }
    
    /**
     * Sets (as xml) the "isTreeNode" element
     */
    public void xsetIsTreeNode(org.apache.xmlbeans.XmlBoolean isTreeNode)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlBoolean target = null;
            target = (org.apache.xmlbeans.XmlBoolean)get_store().find_element_user(ISTREENODE$6, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlBoolean)get_store().add_element_user(ISTREENODE$6);
            }
            target.set(isTreeNode);
        }
    }
    
    /**
     * Unsets the "isTreeNode" element
     */
    public void unsetIsTreeNode()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(ISTREENODE$6, 0);
        }
    }
    
    /**
     * Gets the "childrenItem" element
     */
    public com.seedwill.xul.core.XPairItem getChildrenItem()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPairItem target = null;
            target = (com.seedwill.xul.core.XPairItem)get_store().find_element_user(CHILDRENITEM$8, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "childrenItem" element
     */
    public boolean isSetChildrenItem()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(CHILDRENITEM$8) != 0;
        }
    }
    
    /**
     * Sets the "childrenItem" element
     */
    public void setChildrenItem(com.seedwill.xul.core.XPairItem childrenItem)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPairItem target = null;
            target = (com.seedwill.xul.core.XPairItem)get_store().find_element_user(CHILDRENITEM$8, 0);
            if (target == null)
            {
                target = (com.seedwill.xul.core.XPairItem)get_store().add_element_user(CHILDRENITEM$8);
            }
            target.set(childrenItem);
        }
    }
    
    /**
     * Appends and returns a new empty "childrenItem" element
     */
    public com.seedwill.xul.core.XPairItem addNewChildrenItem()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XPairItem target = null;
            target = (com.seedwill.xul.core.XPairItem)get_store().add_element_user(CHILDRENITEM$8);
            return target;
        }
    }
    
    /**
     * Unsets the "childrenItem" element
     */
    public void unsetChildrenItem()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(CHILDRENITEM$8, 0);
        }
    }
}
